<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('membership_codes', function (Blueprint $table) {
            $table->timestamp('effective_start_at')->nullable()->after('used_at')->comment('会员生效开始时间');
            $table->timestamp('effective_end_at')->nullable()->after('effective_start_at')->comment('会员生效结束时间');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('membership_codes', function (Blueprint $table) {
            $table->dropColumn(['effective_start_at', 'effective_end_at']);
        });
    }
};